package recursion;

/**
 * 递归反向打印字符串
 *
 * @author yyz
 * @create 2023-11-12 13:05
 */
public class ReverseString {
    private static void f(int n, String str) {
        if (n == str.length()) {
            return;
        }
        f(n + 1, str);
        System.out.print(str.charAt(n));

    }

    public static void main(String[] args) {
        String str = "cbda";
        f(0, str);
    }
}
